<?php
namespace App\Traits;

use App\Models\FakeDetail;
use App\Models\FakeList;
use Illuminate\Http\Request;

Trait Trait34_35 {

    public function doorList()
    {
        $data = [
            ['name' => '门禁A2 001', 'status' => '在线'],
            ['name' => '门禁A2 002', 'status' => '离线'],
            ['name' => '门禁A3 001', 'status' => '在线'],
            ['name' => '门禁A4 001', 'status' => '在线'],
            ['name' => '门禁A5 001', 'status' => '在线'],
            ['name' => '门禁B2 001', 'status' => '在线'],
            ['name' => '门禁B3 001', 'status' => '在线'],
            ['name' => '门禁B3 002', 'status' => '在线'],
            ['name' => '门禁B3 003', 'status' => '在线'],
        ];
        $responseJson = [
            'code' => 200,
            'message' => '',
            'data' => $data
        ];
        return response()->json($responseJson);
    }

    public function doorLog()
    {
        $data1 = [
            'name' => '门禁A2 039',
            '设备状态' => '在线',
            '设备编号' => '文本标签',
            '安装位置' => '文本标签',
            '安装日期' => '文本标签',
            '品牌型号' => '文本标签',
        ];
        $data2 = [
            ['name' => '张三', 'operate' => '开门', 'time' => '07:22'],
            ['name' => '李士', 'operate' => '开门', 'time' => '07:32'],
            ['name' => '王五', 'operate' => '开门', 'time' => '07:52'],
            ['name' => '张三', 'operate' => '关门', 'time' => '09:22'],
        ];
        $data = [
            'detailInfo' => $data1,
            'detailList' => $data2
        ];
        $responseJson = [
            'code' => 200,
            'message' => '',
            'data' => $data
        ];
        return response()->json($responseJson);
    }

}
